<script type="text/javascript" charset="utf-8" src="/Public/admin/js/UEditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/Public/admin/js/UEditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="/Public/admin/js/UEditor/lang/zh-cn/zh-cn.js"></script>

<div class="nav">
   <a class="sel"　href="#">网站基本配置</a>
</div>
<div class="add">
  <form method="post" action="" >
  <table class="table_add">
    <tr>
      <td width="100px">网站名称</td>
      <td><input class="input1" type="text" name="site_name" id="site_name" value="{$site_name}" style="width:200px" />
      <span class="msg">网站对外名称</span>
      </td>
    </tr>
    <tr>
      <td>网站LOGO</td>
      <td>
      <include file="Public/uploadfile" filetype="image" id="site_logo"  value="{$site_logo}" editvalue="{:getEditFiles($site_logo)}" width="100" path="config" limit="1" thumbw="" thumbh="" msg="240px*100px"/>
      
      </td>
    </tr>
    <tr>
      <td width="100px">电话</td>
      <td><input class="input1" type="text" name="site_tel" id="site_tel" value="{$site_tel}" style="width:200px" />
      <span class="msg"></span>
      </td>
    </tr>
    <tr style="display:none">
      <td>新浪微博</td>
      <td><input class="input1" type="text" name="site_weibo" id="site_weibo" value="{$site_weibo}" style="width:500px"  /></td>
    </tr>
    <tr style="display:none">
      <td>腾讯微博</td>
      <td><input class="input1" type="text" name="site_weibo_qq" id="site_weibo" value="{$site_weibo_qq}" style="width:500px"  /></td>
    </tr>
    <tr>
      <td>微信二维码</td>
      <td>
         <include file="Public/uploadfile" filetype="image" id="site_weixin"  value="{$site_weixin}" editvalue="{:getEditFiles($site_weixin)}" width="100" path="config" limit="1" thumbw="" thumbh="" msg="120px*120px"/>
         
      </td>
    </tr>
    
      <tr style="display:none">
      <td>敏感词</td>
      <td><textarea class="textarea1" name="mingganci" id="mingganci" style="width:700px;height:80px;" >{$mingganci}</textarea>
      <div class="msg">词组用斜线(/)分割。</div>
      </td>
    </tr>
    <tr style="display:none">
      <td>顶部欢迎语</td>
      <td><input class="input1" type="text" name="site_welcome" id="site_welcome" value="{$site_welcome}" style="width:500px" /></td>
    </tr>
    <tr>
      <td>版权信息</td>
      <td><input class="input1" type="text" name="site_copyright" id="site_copyright" value="{$site_copyright}" style="width:500px" /></td>
    </tr>
    <tr>
      <td>ICP备案号</td>
      <td><input class="input1" type="text" name="site_icp" id="site_icp" value="{$site_icp}" style="width:500px" /></td>
    </tr>
    <tr>
      <td>服务协议</td>
      <td>
        <script id="editor" type="text/plain" style="width:1024px;height:500px;">{$editorValue}</script>
      </td>
    </tr>

    <tr>
      <td></td>
      <td><input type="submit" class="btn1" value="保存" /> &nbsp; <input class="btn4" type="reset" value="重 置" /> </td>
    </tr>
  </table>
  </form>
</div>
<script>
      var ue = UE.getEditor('editor');

      function isFocus(e){
          alert(UE.getEditor('editor').isFocus());
          UE.dom.domUtils.preventDefault(e)
      }
      function setblur(e){
          UE.getEditor('editor').blur();
          UE.dom.domUtils.preventDefault(e)
      }
      function insertHtml() {
          var value = prompt('插入html代码', '');
          UE.getEditor('editor').execCommand('insertHtml', value)
      }
      function createEditor() {
          enableBtn();
          UE.getEditor('editor');
      }
      function getAllHtml() {
          alert(UE.getEditor('editor').getAllHtml())
      }
      function getContent() {
          var arr = [];
          arr.push("使用editor.getContent()方法可以获得编辑器的内容");
          arr.push("内容为：");
          arr.push(UE.getEditor('editor').getContent());
          alert(arr.join("\n"));
      }
      function getPlainTxt() {
          var arr = [];
          arr.push("使用editor.getPlainTxt()方法可以获得编辑器的带格式的纯文本内容");
          arr.push("内容为：");
          arr.push(UE.getEditor('editor').getPlainTxt());
          alert(arr.join('\n'))
      }
      function setContent(isAppendTo) {
          var arr = [];
          arr.push("使用editor.setContent('欢迎使用ueditor')方法可以设置编辑器的内容");
          UE.getEditor('editor').setContent('欢迎使用ueditor', isAppendTo);
          alert(arr.join("\n"));
      }
      function setDisabled() {
          UE.getEditor('editor').setDisabled('fullscreen');
          disableBtn("enable");
      }

      function setEnabled() {
          UE.getEditor('editor').setEnabled();
          enableBtn();
      }

      function getText() {
          //当你点击按钮时编辑区域已经失去了焦点，如果直接用getText将不会得到内容，所以要在选回来，然后取得内容
          var range = UE.getEditor('editor').selection.getRange();
          range.select();
          var txt = UE.getEditor('editor').selection.getText();
          alert(txt)
      }

      function getContentTxt() {
          var arr = [];
          arr.push("使用editor.getContentTxt()方法可以获得编辑器的纯文本内容");
          arr.push("编辑器的纯文本内容为：");
          arr.push(UE.getEditor('editor').getContentTxt());
          alert(arr.join("\n"));
      }
      function hasContent() {
          var arr = [];
          arr.push("使用editor.hasContents()方法判断编辑器里是否有内容");
          arr.push("判断结果为：");
          arr.push(UE.getEditor('editor').hasContents());
          alert(arr.join("\n"));
      }
      function setFocus() {
          UE.getEditor('editor').focus();
      }
      function deleteEditor() {
          disableBtn();
          UE.getEditor('editor').destroy();
      }
      function disableBtn(str) {
          var div = document.getElementById('btns');
          var btns = UE.dom.domUtils.getElementsByTagName(div, "button");
          for (var i = 0, btn; btn = btns[i++];) {
              if (btn.id == str) {
                  UE.dom.domUtils.removeAttributes(btn, ["disabled"]);
              } else {
                  btn.setAttribute("disabled", "true");
              }
          }
      }
      function enableBtn() {
          var div = document.getElementById('btns');
          var btns = UE.dom.domUtils.getElementsByTagName(div, "button");
          for (var i = 0, btn; btn = btns[i++];) {
              UE.dom.domUtils.removeAttributes(btn, ["disabled"]);
          }
      }

      function getLocalData () {
          alert(UE.getEditor('editor').execCommand( "getlocaldata" ));
      }
      function clearLocalData () {
          UE.getEditor('editor').execCommand( "clearlocaldata" );
          alert("已清空草稿箱")
      }
</script>

